import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import "../scss/list.scss";

function LinkList(props) {
    const listPage = props.list;
    const listItems = listPage.map((item, index) =>
        <Link to={item.page} key={index}>
            <li className="li-link">
                {item.id}. {item.name}
            </li>
        </Link>
    );
    return (
        <ul className="list-ul">{listItems}</ul>
    );
}
class listKey extends Component {
    render () {
        const listArr = [
            {
                name: 'radio 单选按钮',
                id: 1,
                page: 'radio'
            }
        ];
        return (
            <LinkList list={listArr}/>
        )
    }
}

export default listKey;
